Skip to content

Handling NaN nodata values in reclassify_raster#465

Merged
davemfish merged 2 commits intonatcap:mainfrom
phargogh:bugfix/454-reclassify-raster-not-handling-nan
Mar 2, 2026
Merged

Handling NaN nodata values in reclassify_raster#465
davemfish merged 2 commits intonatcap:mainfrom
phargogh:bugfix/454-reclassify-raster-not-handling-nan

Conversation

@phargogh
Copy link
Copy Markdown
Member

@phargogh phargogh commented Feb 27, 2026

This small PR handles the case where a raster passed to pygeoprocessing.reclassify_raster has a NaN nodata value. I chose to use pygeoprocessing.array_equals_nodata instead of simply adding equals_nan=True to numpy.isclose so that we could take advantage of the special case speedups that are handled in that helper function.

Dave and Claire, I requested a review from both of you because you were discussing this over in #454.

Fixes:#454

Readthedocs build failures are addressed in #470

Copy link
Copy Markdown
Contributor

@claire-simpson claire-simpson left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Looks good to me, thanks @phargogh!

Copy link
Copy Markdown
Contributor

@davemfish davemfish left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks, @phargogh

@davemfish davemfish merged commit 9e502a7 into natcap:main Mar 2, 2026
170 of 174 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants